package com.brightgenerous.niconama05.work4;

import javax.swing.JFrame;

import com.brightgenerous.niconama05.anime.Interviewer;
import com.brightgenerous.niconama05.anime.product.Ichigomashimaro;
import com.brightgenerous.niconama05.anime.product.Yuruyuri;

/**
 * 一般 4
 * 
 * @author brigen
 */
class Ippan4 implements Interviewer {

	/**
	 * 苺ましまろをインタビューする
	 *
	 * @param x_ichigomashimaro 苺ましまろ
	 */
	@Override
	public void interview(Ichigomashimaro x_ichigomashimaro) {
		StringBuilder sb = new StringBuilder();
		sb.append("<html><head><title>");
		sb.append(x_ichigomashimaro.getTitle());
		sb.append("</title></head><body>");
		sb.append("<h1>").append(x_ichigomashimaro.getTitle()).append("</h1>");
		sb.append("<p>").append(x_ichigomashimaro.getDescription()).append("</p>");
		sb.append("<table border=\"1\">");
		sb.append("<tbody><tr>");
		sb.append("<td>").append(x_ichigomashimaro.getChika().getName()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getMiu().getName()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getMatsuri().getName()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getAna().getName()).append("</td>");
		sb.append("</tr><tr>");
		sb.append("<td>").append(x_ichigomashimaro.getChika().getActor()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getMiu().getActor()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getMatsuri().getActor()).append("</td>");
		sb.append("<td>").append(x_ichigomashimaro.getAna().getActor()).append("</td>");
		sb.append("</tr><tr>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_ichigomashimaro.getChika().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_ichigomashimaro.getMiu().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_ichigomashimaro.getMatsuri().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_ichigomashimaro.getAna().getURL()).append("\"/></td>");
		sb.append("</tr></tbody>");
		sb.append("</table>");
		sb.append("</body></html>");

		JFrame frame = new HtmlFrame(sb.toString());
		frame.setVisible(true);
	}

	/**
	 * ゆるゆりをインタビューする
	 *
	 * @param x_yuruyuri ゆるゆり
	 */
	@Override
	public void interview(Yuruyuri x_yuruyuri) {
		StringBuilder sb = new StringBuilder();
		sb.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
		sb.append("<html><head><title>");
		sb.append(x_yuruyuri.getTitle());
		sb.append("</title></head><body>");
		sb.append("<h1>").append(x_yuruyuri.getTitle()).append("</h1>");
		sb.append("<p>").append(x_yuruyuri.getDescription()).append("</p>");
		sb.append("<table border=\"1\">");
		sb.append("<tbody><tr>");
		sb.append("<td>").append(x_yuruyuri.getAkari().getName()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getKyoko().getName()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getYui().getName()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getChinatsu().getName()).append("</td>");
		sb.append("</tr><tr>");
		sb.append("<td>").append(x_yuruyuri.getAkari().getActor()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getKyoko().getActor()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getYui().getActor()).append("</td>");
		sb.append("<td>").append(x_yuruyuri.getChinatsu().getActor()).append("</td>");
		sb.append("</tr><tr>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_yuruyuri.getAkari().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_yuruyuri.getKyoko().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_yuruyuri.getYui().getURL()).append("\"/></td>");
		sb.append("<td><img width=\"160\" height=\"90\" src=\"").append(x_yuruyuri.getChinatsu().getURL()).append("\"/></td>");
		sb.append("</tr></tbody>");
		sb.append("</table>");
		sb.append("</body></html>");

		JFrame frame = new HtmlFrame(sb.toString());
		frame.setVisible(true);
	}
}
